#include <iostream>
using namespace std;

class Solution {
public:
    bool isPalindrome(int x) {
        if(x < 0)
            return false;
        int temp_num = x;
        int reverse_number = 0;
        while (temp_num != 0) {
            reverse_number = reverse_number * 10 + (temp_num % 10);
            temp_num /= 10;
        }
        return reverse_number == x;
    }
};

int main(int argc, char const *argv[]) {
    Solution test;
    cout << test.isPalindrome(121) << endl;
    cout << test.isPalindrome(-121) << endl;
    cout << test.isPalindrome(10) << endl;
    cout << test.isPalindrome(1000021) << endl;
    return 0;
}